Method for high precision lens distortion calibration and removal

ABSTRACT

The present application relates to a high precision method for calibrating and removing distortion from a lens, and more particularly, a method for calibrating and removing distortion by arranging sensor readings to compensate for its presence and simultaneously optimize the resulting image magnification for best image quality.

FIELD OF THE INVENTION

The present invention relates to a high precision method for calibrating and removing distortion from a lens, and more particularly, a method for calibrating and removing distortion by arranging sensor readings to compensate for its presence and simultaneously optimize the resulting image magnification for best image quality.

BACKGROUND OF THE INVENTION

An optical instrument is generally required to produce a geometrically consistent image of a given object, where each point is imaged as a point in the image. The image is generally formed in accordance with some predefined imaging model, which in this case, is assumed to be a projective camera. The departure of practical optical systems from ideal behavior leads to the introduction of aberrations in the resulting images. The aberration here is lens distortion, a well known monochromatic aberration, which is present in both color and greyscale imaging devices. Its nature is predominantly a radial geometric displacement of pixels giving a barrel or a pincushion effect but without loss of image quality.

Lens distortion is a thorn in the side of many relatively straightforward image analysis tasks. It comprehensively degrades the accuracy of measurements made in real images, where pixels in a normal perspective camera can typically be displaced by up to ten percent of the image width.

One known method for addressing lens distortion is in conjunction with a complete calibration of the camera system. Complete camera calibration essentially means that the camera's internal and external parameters are obtained. Internal parameters roughly relate to the camera lens, such as focal length and optical axis. Lens distortion parameters may be considered as an add-on to the set of internal camera parameters. The external parameters relate to the positioning of the camera. Such conventional camera calibration methods are disclosed in many research papers. The importance of distortion in this regard has seen the utter dominance of these more complicated algorithms at the expense of those that do not consider distortion.

Despite this, many applications do not require the full complement of internal camera parameters and the relative orientation in relation to some calibration target. Non-metric applications differ in that they do not necessarily employ the lens or external characteristics in determining distortion.

In the 1960's Duane C. Brown, working in the area of photogrammetry, proposed a method for determining lens distortion based on the truism that straight lines must be imaged as straight lines. This technique, published in (Brown, 1971), and with extensions in (Fryer and Brown, 1986), became known as the ‘plumb line’ method, where initially fine white thread was stretched by plumb bobs which were stabilized in an oil bath. A comprehensive historical review is given in Clarke and Fryer (1998). This technique was adopted by the machine vision community where simplified versions of the plumb line method were presented, e.g. Prescott and McLean (1997b), (also as patent Prescott and McLean (1997a) XP000683415) Haneishi et al. (1995a) (also as patent Haneishi et al. (1995b) XP000527216) Poulo and Gorman (1999) U.S. Pat. No. 6,002,525 and Asari et al. (1999) all describe a similar truism based correction for the correction of distortion using images of co-linear points. Similarly, high level distortion is considered in Brauer-Burchardt and Voss (2001), however the real example shown, with a quoted residual distortion of ±0.7 pixels, resembles a quite benign distortion level. Since these methods only estimate distortion, they are sometimes referred to as non-metric calibration.

An intrinsic problem for the multiple line based methods is that it becomes intractable to form geometric relationships between a distorted line segment and its true projection. An alternating approach was employed, for example in Devernay and Faugeras (2001), Tzu-Hung (2003) and Bing (1999) EP0895189, which iteratively adjusts the distortion parameters in order to minimize the line fitting to the distorted line segments. No meaningful geometric relationship exists between this objective error and the distortion parameters, hence no analytical derivatives are available. This results in slow convergence and can become unstable for elevated distortion levels, unless special steps are taken, as in Swaminathan and Nayar (2000). In this non-metric approach Swaminathan and Nayar (2000) reformulated the objective function in distorted space instead of the usual undistorted space. This is done by performing a further search at each alternation to find the location of a point closest to the considered distorted point, but that lies exactly on the line fitted to the current undistorted point estimates. The reported results showed improved robustness to noise for simulated data but no meaningful performance was reported in the real case.

Another approach has been suggested in Ahmed and Farag (2001) where the curvature of detected lines are used to estimate the parameters of the derivative distortion equation. However, the simulation results showed abysmal performance in the presence of noise, while the real results lacked a qualitative evaluation.

A more standard means of calibrating distortion is with the simultaneous estimation of a camera's extrinsic and intrinsic parameters. Tsai's method (Tsai, 1987) involves simultaneously estimating, via an iterative numerical optimization scheme, the single distortion parameter and some internal parameters such as focal length, given the 3D position of a set of control points. The external parameters or position of the camera is already computed in a previous step. The disadvantage of this approach is that it requires known 3D control points and in return offers relatively low accuracy for all but simple distortion profiles. Algorithmic variations on this principal have been proposed by some, such as Weng et al. (1992) and Wei and Ma (1994) using more appropriate models for lens distortion. These methods also require known 3D control points.

The generation of distortion corrected images is investigated in Heikkila and Silven (1997), while Heikkila (2000) describes a similar technique that requires 3D control points or multiple image sets of 2D control points. An alternative method also based on multiple sets of 2D control points has been advanced in Zhang (1998, 2000) and Sturm and Maybank (1999). This technique addresses distortion through an alternating linear least squares solution which is then iteratively adjusted in a numerical minimization including all estimation parameters. The relative complexity of these techniques is increased by the inclusion of lens distortion.

On the other hand there are many situations where only distortion removal is required, not the full complement of intrinsic and extrinsic parameters. An example is in the estimation of multiple view geometry in real images, where techniques have been specifically developed to accommodate lens distortion. Zhang (1996) investigates the possibility of simultaneously estimating distortion parameters and the Fundamental Matrix. The results conclude that this is possible if noise is low and distortion is high. Fitzgibbon (2001) (with patent Fitzgibbon (2003) GB2380887), Micusik and Pajdla (2003) and Barreto and Daniilidis (2004) use an alternative model for distortion, leading to a polynomial Eigenvalue problem and a more reliable estimation of distortion and geometry. Stein (1997) took the reverse approach and used the error in Fundamental Matrix estimation as an objective error to estimate distortion parameters.

Alternative methods of distortion calibration exist, where control points correspondences are abandoned in favor of distortion free scenes. These scenes are then imaged by the camera system, whereupon an image alignment process is conducted to correct for distortion. Lucchese and Mitra (2003) describe a technique where the distorted image is warped until it registers (in intensity terms) with the reference image. A similar technique using a coarse filter to find registration is described in Tamaki (2002) (with patent Tamaki et al. (2002) US2002057345) while Sawhney and Kumar (1999) (also with patent Kumar et al. (1998) WO9821690) describe a registration technique that does not require an undistorted reference image. Instead, multiple images are registered for the generation of a mosaic image, for example such as a panoramic resulting from the combination of several different views, and distortion is simultaneously estimated. These techniques have a very high computational overhead, with twenty minutes quoted in Tamaki (2002).

A final class of non-metric calibration methods are based on distortion induced high-order correlations in the frequency domain. Farid and Popescu (2001) describe a technique, however its performance is poor in comparison with regular camera calibration techniques and it also appears to be slightly dependent on the image content. Yu (2004) further develops this approach with alternative distortion models and reports accuracy approaching that achieved with regular camera calibration if the source image is of a regular calibration target. Finally, a means of fabricating a curved CCD array has been suggested by Gary (2003) US2003141433. In the lens distortion profile is copied in the array by a series of line segments, thus the resulting image appears distortion free.

SUMMARY

The solution provided herein may be considered non-metric as no regular internal or external camera parameters are explicitly required. This solution is found with much higher stability and precision than other non-metric approaches. The performance at least matches, and often surpasses, that of complete calibration methods. Its practical implementation is very straightforward, requiring the camera to capture only a single view of a readily available calibration target. A more complete understanding of the invention will be appreciated from the description and accompanying drawings and the claims which follow.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other features and advantages of the present invention will be more fully understood from the following detailed description of illustrative embodiments, taken in conjunction with the accompanying drawings in which:

FIG. 1 is a graphical interpretation of the formation of a distorted image and its undistorted counterpart;

FIG. 2A is an original distorted image;

FIG. 2B is a resampled image;

FIG. 2C is an optimally adjusted resampled image;

FIG. 3 is a table showing the properties of a proposed algorithm of Method 1 in comparison to alternate techniques;

FIG. 4 is a table of residual errors for Method 1 in mean (SD) format;

FIG. 5 is a table of Residual Errors for a prior art method (Method 2) in mean (SD) format;

FIG. 6 is a table of Residual errors for a prior art (Method 3) in mean (SD) format;

FIG. 7 is a table of Residual errors for a prior art (Method 4) in mean (SD) format;

FIG. 8 is a table of real distortion samples, including the number of iterations for each of the methods where available;

FIGS. 9A, 9B and 9C are illustrations showing three calibration images;

FIG. 9D is an illustration of an evaluation image;

FIG. 10 is a table of distortion residuals on real examples;

FIG. 11 is a table of a comparison of Method 1 to prior art method 2 both using the same distortion model (i.e. two parameter radial model);

FIGS. 12A, 12B and 12C are corrected evaluation images;

FIG. 13 illustrates Method 1 parameters with scaled 95% uncertainty bound;

FIG. 14 illustrates Method 2 parameters;

FIG. 15 illustrates Method 3 parameters with scaled 95% uncertainty bound;

FIG. 16 illustrates Method 4 parameters with scaled 95% uncertainty bound;

FIG. 17 illustrates a graph of the Mean and SD errors for the 4 methods computed over 100 random positions of control points;

FIG. 18 illustrates the mean estimated distortion center less the ideal value, for the 4 methods over the range of distortion;

FIG. 19 illustrates the mean and SD of parameter values for Method 1 over the 100 randomly chosen control point locations;

FIG. 20 illustrates the mean and SD of parameter values for Method 2 over the 100 randomly chosen control point locations;

FIG. 21 illustrates mean and SD of parameter values for Method 3 over the 100 randomly chosen control point locations;

FIG. 22 illustrates mean and SD of parameters values for Method 4 over the 100 randomly chosen control point locations;

FIG. 23 is a table illustrating the estimates of the distortion center for each of the prior art methods 2, 3 and 4 and the method of the present application,

FIG. 24 is an exemplary process flow for determining the distortion parameters of Method 1, and

FIG. 25 is an exemplary process flow for correcting an image using the distortion parameters as determined from the Method of FIG. 24.

DETAILED DESCRIPTION

The present invention addresses a problem of geometric distortion in optical systems by rearranging the sensor readings to compensate for its presence. Any array type lens system is applicable such as infrared sensors and optical laser deflection systems, color and monochrome cameras regardless of resolution. The method of the present invention is highly accurate, stable and suitable for all levels of lens distortion. The correction method of the present application may be applied to both RAW and processed images. However, where other corrections for other distortions are also applied, the process may more suitably be performed on RAW format images in advance of or subsequent to the other correction processes.

Many calibration methods are complicated to carry out, requiring multiple views of a target while avoiding degenerate configurations. Their software requirements are also nontrivial, often requiring a complete nonlinear bundle adjustment optimization. Whilst these methods may be suitable for complex industrial applications, they are not generally suitable for mass produced consumer products. In contrast, the method of the present invention provides a simpler method requiring one view of a calibration target which may be easily taken in a fronto parallel position. The position of the pattern relative to the camera coordinate system is not required. Two constraints are placed on the calibration target, that of planarity and known structure. These requirements are easily met, for example a regular pattern such as a chessboard has a regular grid structure and is easily made planar. The method does not require that the pattern be present in a specific location or orientation merely that the structure is known and entirely captured in an acquired image on the sensor. By known structure, it is meant that the configuration of the pattern is known in 2 dimensions (e.g. for a checkerboard pattern the number of square in each dimension in contrast the physical size is not important).

In addition, the problem of optimally forming a new aberration free image from an initial digital representation is addressed. The optimization is focused on minimizing the unavoidable resampling errors due to the sealing and sheering effects of the digital interpolation. As discussed below, a mathematical formulation is described to automatically compute an affine transform to minimize these distortions, improving the overall image quality.

As described in the background, lens distortion can comprehensively degrade the accuracy of measurements made in real images, where pixels in a normal perspective camera with a low focal length may move up to 30 pixels. In terms of the removal of such distortions, a precise means of calibrating and removing distortion is in conjunction with a full calibration of the internal and external parameters. The importance of distortion in this regard has seen the utter dominance of these more complicated algorithms at the expense of those that do not consider distortion. Despite this, many applications do not require the full complement of internal camera parameters and the relative orientation in relation to some calibration target. Selections of these, such as multiple view geometry estimation, in cases prefer to explicitly include lens distortion factors at the expense of extra complexity.

Algorithms for internal and external camera calibration, multiple view geometry estimation, etc. are rendered considerably simpler by the lack of lens distortion. However, despite the long term existence of non-metric calibration techniques to enact this removal of distortion, they have not been adopted. It is believe, that this may be due to poor performance of such methods, their limited circumstances of usage, and their own relatively complex practical implementation. The present application comprehensively teaches an easy to use and highly precise method for calibrating lens distortion of all levels in perspective cameras.

The present application is non-metric, as no internal or external camera parameters are explicitly available or required (although where the camera parameters are adjustable, these may be employed as inputs to improve performance). Non-metric refers to the unavailability of any internal or external camera parameters or orientations. The method exploits two geometric priors on the planarity of the control points and their known structure up to an arbitrary scale. Using a single view of the calibration pattern, an error function is formed in distorted space using a conventional mathematical distortion model. It will be appreciated that the model may be rewritten in non-distorted space, however this has the disadvantage of possibly reduced precision. As will be discussed below, the necessary undistorted coordinates are simultaneously estimated through a general projective transform. The partial derivatives of a quadratic cost function are then computed for all estimated parameters, allowing the closed form computation of the cost gradients for minimization. The resampling of an aberration free image is interpreted as a function (using resampling) in distortion free coordinate space, hence the calibrated forward distortion model generated by the method may be applied directly to distorted images. Automatic resealing may be applied to balance the creation and loss of pixels in this resampling.

In comparison with the current benchmark for calibrating distortion through full camera calibration, the proposed approach has numerable advantages. Only one input image is required for the calibration, ideally taken in a roughly fronto parallel position. The distortion and associated parameters are estimated in a closed form solution with full partial derivatives, giving a computational advantage over current numerical techniques. Closed form in this sense refers to the direct geometric relationship between the criterion and the underlying model, meaning that it is absolutely correct at all times not just upon convergence conditions. The accuracy of the method matches and surpasses that of complete calibration over a general coverage of all possible distortion levels in perspective cameras. It also offers an alternative means of dealing with distortion for the many tasks that do not require the full complement of camera parameters. Additionally, the subsequent calibration of internal and/or external camera parameters becomes much simpler in the absence of lens distortion.

In an embodiment, the calibration technique pursued requires one view of a calibration pattern. Two geometric priors are assumed on this calibration target, that of planarity and of known (up to an arbitrary scale) canonical coordinates for the pattern defined control points. Additionally, it can be assumed that all control points are observable within the image window and are appropriately ordered so as to correspond with the scaled canonical model.

Considering the detection of a chessboard in an unknown position, the intersections with image coordinates are denoted as shown in Equation 1, with units of pixels (pix), a straight forward transform (subtracting fixed values from each of the x and y co-ordinates with scaling for stability purposes when performing calculations, inverse translation and scaling are subsequently applied when correcting an image) is specified to convert these measurements into a lens centered coordinate space.

c=( ū, v,1)^(T)  (1)

where c is the vector of pixel (control point) measurements made with ū being the x co-ordinate, v being the y co-ordinate (Note: this is expressed and all equations hence are expressed in homogenous form unless stated otherwise).

The required lens centric transform may be defined by Equation 3 below;

$\begin{matrix} {\overset{\_}{p} = {{\begin{pmatrix} s & 0 & {- u_{o}} \\ 0 & s & {- v_{o}} \\ 0 & 0 & 1 \end{pmatrix}\begin{pmatrix} \overset{\_}{u} \\ \overset{\_}{v} \\ 1 \end{pmatrix}} = {A\overset{\_}{c}}}} & (3) \end{matrix}$

The lens centric coordinate system obtained by this Euclidian transform applied to measured values can be thought of as the actual metric measurements of the ray intersections with the surface of the sensor pickup (e.g. CCD array), centered on the optical axis of the lens. As most sensors are not aligned accurately with respect to the lens, the center of the sensor array cannot be assumed to contain the optical axis. The precise metric values of the ray intersections are not required to influence the scale of the distortion parameters.

Arbitrary scaling of lens centric coordinates, or equivalently varying sensor resolution, causes the parameter values of distortion to change, not the number of parameters as is clear from Equation 2 below where λ is an arbitrary scale and the proof which follows.

λ( p−p)=λD(p,k)=D(λp,k _(λ)),  (2)

where λ is the scaling factor and k_(λ) is the scaled parameter vector.

$\begin{matrix} {{\underset{\_}{Proof}:{\lambda \; {D\left( {p,k} \right)}}} = {D\left( {{\lambda \; p},k_{\lambda}} \right)}} \\ {{= {\lambda \begin{pmatrix} {{k_{1}\lambda^{2}{xr}^{2}} + {k_{2}\lambda^{4}{xr}^{2}} + \ldots} \\ {{k_{1}\lambda^{2}\; y\; r^{2}} + {k_{2}\lambda^{4}y\; r^{2}} + \ldots} \end{pmatrix}}},} \\ {{= {\lambda \; {D\left( {p,k} \right)}}},} \end{matrix}$

As k_(λ) absorbs the scaling factors as: k_(λ)=(λ²k₁, λ⁴k₂, . . . )^(T)

As a consequence, the recovered control points are normalized roughly to unit length by the average of the image width and height to standardize the scaling of the distortion parameters and improve the conditioning of the estimation equations.

In the present application, references to the Forward model refer to the system models formulated in distorted space and references to the Reverse model refer to models formulated in undistorted space.

The Forward model of distortion will now be derived and its advantages in comparison with other models theoretically argued and experimentally shown. The distortion may be expressed as shown in Equation 4 below:

p=p+D(p,k)  (4)

Where D(p,k) is expressed in Equation 5 below:

$\begin{matrix} {{D\left( {p,k} \right)} \approx \begin{pmatrix} {{{k_{1}{xr}^{2}} + {k_{2}{xr}^{4}} + {k_{3}{xr}^{6}} + \ldots}\mspace{14mu}} \\ {{k_{1}y\; r^{2}} + {k_{2}y\; r^{4}} + {k_{3}y\; r^{6}} + \ldots +} \\ {{\left( {{p_{1}\left( {{3x^{2}} + y^{2}} \right)} + {2p_{2}{xy}}} \right)\left( {1 + {p_{3}r^{2}} + \ldots}\mspace{14mu} \right)} +} \\ {\left( {{2p_{1}{xy}} + {p_{2}\left( {{3y^{2}} + x^{2}} \right)}} \right)\left( {1 + {p_{3}r^{2}} + \ldots}\mspace{14mu} \right)} \end{pmatrix}} & \left. 5 \right) \end{matrix}$

In this function, the radial distortion component is represented by k₁, k₂ and k₃ while the distortions introduced by decentering correspond to p₁, p₂ and p₃. These are combined into the parameter vector k=(k₁, k₂, k₃, . . . p₁, p₂ . . . )^(T). It will be appreciated that for radial distortion we are not concerned with the tangential distortion coefficients of p₁ p₂ and p₃ although the method may account for these automatically as will be discussed in detail below.

Given the normalized coordinates, {hacek over (c)}, of an arbitrarily oriented planar target, a planar transform or homography may be computed as shown in FIG. 1.

A projective 3×3 transformation H_(d) can be computed between the captured image co-ordinates and a co-ordinate system for the known calibration target. This may be computed from the equation below:

min Σ( c,H _(d) w )²

where w are the canonical co-ordinates of the control points of the pattern (e.g. the corners in a chessboard pattern) with unknown scale.

The application of H_(d) results in {tilde over (c)} as shown below:

{tilde over (c)}=H _(d) w,

H_(d) accounts for scale and position which when combined with H_(e) described below accounts for the unknown undistorted set of points from the measured set. The transform H_(d) may readily be determined using a conventional least squares system to match the acquired image of the calibrated target with its known representation.

In addition, a distortion free projection of planar points, viewed from an arbitrary position, may be related to their distorted counterparts through the application of a general projective transform H_(e) as shown below:

c=H _(e) {tilde over (c)}  (6)

Equation 6 represents a key element in expressing distortion in a closed-form solution, enabling the recovery of the previously unavailable data c, through the simultaneous estimation of 3×3 matrix transform H_(e). Without loss of generality, H_(e) is scaled so that h₃₃ is one. In practice, no further constraints are available on H_(e) as the estimate of H_(d) is corrupted due to noise.

A general form for H_(e) is to absorb inaccuracies. For each observed control point {hacek over (c)}_(i) an error function, as in Equation 7 may be formed.

e _(i)({hacek over (c)} ₁,φ)=H _(e) {tilde over (c)} _(i) +D(H _(e) {tilde over (c)} _(i) ,k)−A{tilde over (c)} _(i)  (7)

, where the full parameter vector is φ=(h₁₁, h₁₂, . . . , s, u₀, v₀, k₁, k₂) with φεIR^(nφ)

It will be appreciated that φ represents all of the unknown parameters.

In solving a problem, a parameter counting exercise shows that for a parameter vector of length n_(φ), a minimum of m=ceil(n_(φ)/2) control point observations (for example corners in a chessboard pattern) are required, where ceil ( ) is rounding towards +∞. Given at least n≧m observations, a least square solution may be obtained by Equation 8:

$\begin{matrix} {{\min {\sum\limits_{i = 1}^{n}{e_{i}\left( {{\overset{\Cup}{c}}_{i},\hat{\varphi}} \right)}^{2}}} = \begin{pmatrix} {e_{i}\left( {{\overset{\Cup}{x}}_{i},\hat{\varphi}} \right)}^{2} \\ {e_{i}\left( {{\overset{\Cup}{y}}_{i},\hat{\varphi}} \right)}^{2} \end{pmatrix}} & (8) \end{matrix}$

This problem is nonlinear requiring a nonlinear optimization solution_One standard way of solving such an equation is to linearize it Equation 8 with some initial parameter value of φ₀, resulting in an iterative Gauss-Newton scheme which can be solved using many robust least square techniques, such as Equation 9:

$\begin{matrix} {{\overset{\Cap}{\varphi}}_{k + 1} = {{\overset{\Cap}{\varphi}}_{k} - {{\lambda\left( {\frac{\partial{e^{T}\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi}\frac{\partial{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi^{T}}} \right)}^{- 1}\frac{\partial{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi^{T}}{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}}} & (9) \end{matrix}$

Such techniques for solving systems will be readily familiar to those skilled in the art.

An analysis by the inventor of the noise in the detected data revealed that the data covariances are approximately equal, so that no covariance matrix is required in this solution (covariance is effectively equal to an identity matrix).

An initial estimate for the parameters of A are s=l, u_(o)=m_(x) and v_(o)=m_(y), where m_(x) and m_(y) are the normalized coordinates of the image center. Alternatively, an initial estimate for the parameters h₁₁, h₂₂ and k_(l), may be obtained directly from the linear solution of Equation 10:

h_(dieg), k_(l))^(T)=T+b, where

${T = \begin{pmatrix} {\overset{\sim}{x}}_{1} & {{\overset{\sim}{x}}_{1}{\overset{\sim}{r}}_{1}^{2}} \\ {\overset{\sim}{y}}_{1} & {{\overset{\sim}{y}}_{1}{\overset{\sim}{r}}_{1}^{2}} \\ \; & \vdots \\ {\overset{\sim}{y}}_{n} & {{\overset{\sim}{y}}_{n}{\overset{\sim}{r}}_{n}^{2}} \end{pmatrix}},\mspace{14mu} {b = \begin{pmatrix} {{\overset{\sim}{u}}_{1} - m_{x}} \\ {{\overset{\sim}{v}}_{1} - m_{y}} \\ \vdots \\ {{\overset{\sim}{v}}_{n} - m_{y}} \end{pmatrix}},$

where {tilde over (x)}=ũ−m_(x), {tilde over (v)}_(y)={tilde over (v)}−m_(y), {tilde over (r)}²={tilde over (x)}²+{tilde over (v)}_(y) ² and (.)⁺ denotes the pseudo inverse.

From which the parameter vector including three terms for radial distortion may then be initialized, as in Equation 11:

φ=(h _(dieg),0,−m _(x),0,h _(dieg) ,−m _(y),0,0,1,−m _(x) ,−m _(y) ,k _(i),0,0)^(T)

Using either method for initialization, it will be appreciated that the solution of equation 8 provides sufficient information to subsequently remove distortion from any captured image by resampling or image warping.

Resampling or image warping computes new samples on a target image from original samples on a source image. Two frequently used and well known interpolation filters are nearest neighbor and bilinear interpolation, although it will be appreciated that others may be employed. The formation of a new undistorted image I(x) may be formed from an distorted image {hacek over (I)}(x) knowing the forward distortion model parameters from the original image as in Equation 12:

I(x)=R({hacek over (I)}(x+D(x,{circumflex over (k)})))  12)

Equation 12 has an advantage that the calibrated forward distortion model may be used directly, without a need for an inverse function.

The modeling of distortion, according to Equation 7, does not consider the optimal formation of a new distortion free image. Thus, for barrel distortion, image warping according to Equation 12 results in the stretching of central pixels to occupy the viewing window, and hence the loss of outer perimeter pixels as other techniques do as well. The reverse case is seen when the new image is compressed into the viewing window, due to the use of an inverse distortion model in the resampling. This image stretching effectively results in a reduction of window size, as illustrated in FIG. 2, which brings forth two issues. Firstly, there is a reduction in the effective field of view or angle of view. This is counter productive as wide angle lenses are chosen for their wide angle of view. Secondly, there is an increase in noise and a degradation of image quality in comparison to the original image, due to the creation of new pixels by zooming-like action of the warping.

To address this issue, the image warping of Equation 3 is modified, by taking into account local pixel distortions. These pixel distortions are the result of the increasing pixel area warping, radially from the center of the lens distortion. By introducing the ability to compress pixels in the resampling process, the overall pixel distortions may be balanced or minimized. This is accommodated by introducing all appropriate scaling matrix S into the resampling in Equation 13:

I(x)=R(Ī( Sx+D(Sx,{circumflex over (k)}))),  13)

where the scaling matrix s contains one variable s, as

${S = \begin{pmatrix} s_{1} & 0 & {{s_{1}{\hat{u}}_{0}} - {\hat{u}}_{0}} \\ 0 & s_{1} & {{s_{1}{\hat{v}}_{0}} - {\hat{v}}_{0}} \\ 0 & 0 & 1 \end{pmatrix}},$

and (û₀, v _(o)) is the estimated distortion center

A measure of the local pixel distortion may be compiled by taking the Jacobian of the local, area around point p as in Equation 14:

$\begin{matrix} {{J(p)} = \begin{pmatrix} {1 + \frac{\partial{D_{x}\left( {p,k} \right)}}{\partial x}} & \frac{\partial{D_{x}\left( {p,k} \right)}}{\partial y} \\ \frac{\partial{D_{y}\left( {p,k} \right)}}{\partial x} & {1 + \frac{\partial{D_{y}\left( {p,k} \right)}}{\partial y}} \end{pmatrix}} & \left. 14 \right) \end{matrix}$

which gives the size ratio of the newly created pixel at the location p to its original location. If λ₁ and λ₂ are the Eigenvalues of J(p), then the net measure of the local pixel distortion may be obtained by taking its determinant as det(J(p))=λ₁λ₂. Because the Eigenvalues of an orthogonal transform are equal to one, the ideal value of the determinant causing no net size change is also one. A compression of pixel size results in a determinant of less than one, while the enlarging of pixel size results in a determinant greater than one.

Pixel distortion may be minimized by choosing a scaling parameter s_(l) that minimizes Equation 15.

$\begin{matrix} {\min {\sum\limits_{i = 1}^{n}\left( {{\det \left( {s_{1}I_{2 \times 2}{J\left( p_{1} \right)}} \right)} - 1} \right)^{2}}} & \left. 15 \right) \end{matrix}$

As det(AB)=det(A) det(B) A,BεIR^(m×m) and det(s₁I_(2×2))=s₁ ² this minimization can be solved linearly as follows

$s_{1} = \sqrt{\frac{1}{\frac{1}{n}{\sum\limits_{i = 1}^{n}{\det \left( {J\left( p_{i} \right)} \right)}}}}$

The point set p_(i) may be chosen as a grid covering the entire image area. The density of this grid has a very minor influence on the overall scaling parameter s₁.

This improved resampling, by considering the local pixel distortions, is illustrated in FIG. 2. It may be observed that the scaling solution avoids including peripheral areas of the original image as these areas would induce large pixel distortion after image warping. The balance that is reached is a clear improvement in terms of the resulting field of view over the original unsealed method. This formulation assumes that the new image dimensions are the same as the original. An alternative means of implementing the same effective field of view is to enlarge the destination image. The optimal enlargement in this case is described by the scaling matrix S solved with Equation 15.

As described above, decentering the distortion parameters to p₁, p₂ and p₃ do not need to be explicitly included, as the interplay between certain parameters enables the implicit modeling of this type of distortion as will be clear from the proof below, moreover their inclusion may lead to an overparametcrised solution. In particular, considering that the projective error transformation H_(e) may, at least, introduce a variable center point by the simple adjustment of h₃→h₃+Δ_(x), and h₆→h₆+Δ_(y) resulting in equation 16 below.

$\begin{matrix} {{D\left( {{p + \Delta},k} \right)} = {{D\left( {p,k} \right)} + \begin{pmatrix} {{k_{1}{\Delta_{x}\left( {{3x^{2}} + y^{2}} \right)}} + {2k_{2}\Delta_{y}x\; y} + \ldots} \\ {{2k_{1}\Delta_{x}x\; y} + {k_{2}{\Delta_{y}\left( {{3y^{2}} + x^{2}} \right)}} + \ldots} \end{pmatrix} + E}} & \left. 19 \right) \end{matrix}$

Proof: Considering the formulation of distortion as D(H₀{tilde over (c)}, k)=D(p, k) and introducing a pure translation into the results in the shifting of x→x+Δx and y→y+Δy. The two parameter radial distortion model then becomes

D _(x)(p+Δ,k)=k ₁ xr ² +k ₂ xr ⁴ +k ₁Δ_(x)(3x ² +y ²)+2k ₁Δ_(y) xy+k ₂Δ_(x)(5x ⁴+6x ² y ² +y ⁴)+k ₂Δ_(y)(4x ² y+4xy ²)+k₁((3Δ_(x) ²+Δ² _(y))x+2Δ_(x)Δ_(y) y+Δ _(x)Δ² _(y)+Δ³ _(x)+k₂((5Δ_(x) ⁴+6Δ² _(x)Δ² _(y)+Δ⁴ _(y))x+(4Δ³ _(x)Δ_(y)+4Δ_(x)Δ³ _(y))y+Δ ⁵ _(x)+2Δ³ _(x)Δ² _(y)+Δ_(x)Δ⁷ _(y)+ . . . )

Radial distortion is modeled as before, while k₁Δ_(x), k₁Δ_(y), k₂Δ_(x) and k₂Δ_(x) match the decentering terms derived from the wave aberration equation. The basic introduction of a translation element into H_(c) thus models decentering distortion with the additional introduction of a small residual E. This residual may additionally be approximated by a small affine transformation E=Δ_(H).

The objective error e may be rewritten, implicitly modeling decentering distortion as in Equation 17:

e({hacek over (c)},φ)=H _(c) {tilde over (c)}+D(H _(c) {tilde over (c)},k)+Δ_(H) H _(c) {tilde over (c)}−A{hacek over (c)}).  17)

In the least square estimation, the small decentering residual is absorbed by a combination of H_(e) and A in the search for a global minimum. It should also be remembered that these equations are only approximations to the actual lens distortion, so such small adjustments are likely to have a negligible impact.

Although, it will be appreciated by those skilled in the art that the partial derivates of Equation 7 may be readily computed using conventional techniques, some further detail is now included.

Partial derivatives for use in an iterative estimation of distortion may be computed using control points. Each control point contributes to the formation of an objective function which must be minimized, as shown in Equation 18:

({hacek over (c)},φ)=H _(e) {tilde over (c)}+D(H _(e) {tilde over (c)},k)−A{tilde over (c)}  18)

Performing a first order expansion of the error around the last estimate results in a Gauss-Newton scheme that can be iterated utilizing many robust least square techniques, as shown in Equation 19:

$\begin{matrix} {{\hat{\varphi}}_{k + 1} = {{\hat{\varphi}}_{k} - {{\lambda \left( {\frac{\partial{e^{T}\left( {\overset{\Cup}{c},{\hat{\varphi}}_{x}} \right)}}{\partial\varphi}\frac{\partial{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi^{T}}} \right)}^{- 1}\frac{\partial{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi^{T}}{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}}} & 19 \end{matrix}$

in an embodiment, the forward distortion model is computed with three radial distortion parameters with estimated lens centric coordinates of the ideal projections. The derivatives are given exactly as in Equation 20:

$\begin{matrix} {\mspace{20mu} {{{\frac{\partial{e\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}}{\partial\varphi^{T}} = {\begin{pmatrix} \frac{e_{x}\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right)}{\partial\varphi^{T}} \\ \frac{e_{y}\left( {\overset{\Cup}{c},{\hat{\varphi}}_{k}} \right.}{\partial\varphi^{T}} \end{pmatrix} = \begin{pmatrix} {\frac{\partial e_{x}}{\partial H_{e}},{- \overset{\Cup}{u}},1,0,{\hat{x}{\hat{r}}^{2}},{\hat{x}{\hat{r}}^{4}},{\hat{x}{\hat{r}}^{6}}} \\ {\frac{\partial e_{y}}{\partial H_{e}},0,0,1,{\hat{y}{\hat{r}}^{2}},{\hat{y}{\hat{r}}^{4}},{\hat{y}{\hat{r}}^{6}}} \end{pmatrix}}},\mspace{20mu} {{{where}\mspace{20mu}\begin{pmatrix} \frac{\partial e_{x}}{\partial H_{e}} \\ \frac{\partial e_{y}}{\partial H_{e}} \end{pmatrix}} = \begin{pmatrix} {\frac{\partial\hat{x}}{\partial H_{e}} + {k_{1}\left( {{\left( {{3{\hat{x}}^{2}} + {\hat{y}}^{2}} \right)\frac{\partial\hat{x}}{\partial H_{e}}} + {2\hat{x}\hat{y}\frac{\partial\hat{y}}{\partial H_{e}}}} \right)} + \ldots} \\ {\left. {\frac{\partial\hat{y}}{\partial H_{e}} + {{k_{1}\left( {{2\hat{x}\hat{y}\frac{\partial\hat{x}}{\partial H_{e}}} + {\hat{x}}^{2} + {3{\hat{y}}^{2}}} \right)}\frac{\partial\hat{y}}{\partial H_{e}}}} \right) + \ldots} \end{pmatrix}}}{{k_{2}\left( {{\left( {{5{\hat{x}}^{4}} + {6{\hat{x}}^{2}{\hat{y}}^{2}} + {\hat{y}}^{4}} \right)\frac{\partial\hat{x}}{\partial H_{e}}} + {\left( {{4{\hat{x}}^{3}\hat{y}} + {4\hat{x}{\hat{y}}^{3}}} \right)\frac{\partial\hat{y}}{\partial H_{e}}}} \right)} + {k_{2}\left( {\left( {{4{\hat{x}}^{3}\hat{y}} + {4\hat{x}{\hat{y}}^{3}}} \right) + \frac{\partial\hat{x}}{\partial H_{e}} + {\left( {{\hat{x}}^{4} + {6{\hat{x}}^{2}{\hat{y}}^{2}} + {5{\hat{y}}^{4}}} \right)\frac{\partial\hat{y}}{\partial H_{e}}}} \right)} + {k_{2}\left( {\left( {{4{\hat{x}}^{3}\hat{y}} + {4\hat{x}{\hat{y}}^{3}}} \right) + \frac{\partial\hat{x}}{\partial H_{e}} + {\left( {{\hat{x}}^{4} + {6{\hat{x}}^{2}{\hat{y}}^{2}} + {5{\hat{y}}^{4}}} \right)\frac{\partial\hat{y}}{\partial H_{e}}}} \right)} + {k_{3}\begin{pmatrix} {{\left( {{7{\hat{x}}^{6}} + {15{\hat{x}}^{4}{\hat{y}}^{2}} + {9\hat{x}2{\hat{y}}^{4}} + {\hat{y}}^{6}} \right)\frac{\partial\hat{x}}{\partial H_{e}}} +} \\ {\left( {{6{\hat{x}}^{5}\hat{y}} + {12{\hat{x}}^{3}{\hat{y}}^{3}} + {6\hat{x}{\hat{y}}^{5}}} \right)\frac{\partial\hat{y}}{\partial H_{e}}} \end{pmatrix}}}\mspace{20mu} {k_{3}\begin{pmatrix} {{\left( {{6{\hat{x}}^{5}\hat{y}} + {12{\hat{x}}^{3}{\hat{y}}^{3}} + {6\hat{x}{\hat{y}}^{5}} + {\hat{y}}^{6}} \right)\frac{\partial\hat{x}}{\partial H_{e}}} +} \\ {\left( {{{\hat{x}}^{6}9{\hat{x}}^{4}{\hat{y}}^{2}} + {15{\hat{x}}^{2}{\hat{y}}^{4}} + {7{\hat{y}}^{6}}} \right)\frac{\partial\hat{y}}{\partial H_{e}}} \end{pmatrix}}\mspace{20mu} {{{Where}\mspace{20mu}\begin{pmatrix} \frac{\partial\hat{x}}{\partial H_{e}} \\ \frac{\partial\hat{y}}{\partial H_{e}} \end{pmatrix}} = {{{\begin{pmatrix} {\overset{\sim}{x},\overset{\sim}{y},1,0,0,0,{{{- \overset{\sim}{x}}\overset{\sim}{x}} - {\overset{\sim}{x}\overset{\sim}{y}}}} \\ {0,0,0,\overset{\sim}{x},\overset{\sim}{y},1,{{{- \overset{\sim}{y}}\overset{\sim}{y}} - {\overset{\sim}{x}\overset{\sim}{y}}}} \end{pmatrix}/h_{31}}\overset{\sim}{x}} + {h_{32}\overset{\sim}{y}} + 1}}}} & \left. 20 \right) \end{matrix}$

It will be appreciated that these equations may readily be solved using conventional software programming techniques. In particular, the techniques of the present application may be applied irx a variety of different ways in both cameras and projection devices. In the case of a camera, the correction method is applied after an image has been sensed at the camera sensor, whereas in the projection device, it is applied before being presented to the projecting elements.

An exemplary process for correcting a subsequently acquired image using the previously determined parameters. Once an image is acquired, the distortion model is then applied. It will be appreciated that whilst the important factor is that the model is based on measurements taken, the compact nature of the model is such that the model may be applied within the camera. However, the method need not be applied directly within the camera and may be applied to the captured images using external image processing software. The external software may be specifically for the purpose of correcting images or it may be provided as a plug-in for more general image processing software, such as for example Adobe Photoshop™. In one arrangement, a kit is provided to a user including a reference image (checkerboard) and the software to produce correction information for their individual lenses. This information may then be stored and applied as required to images taken using a particular lens to correct for distortion. Where the correction process is included in the camera, less expensive lenses may be employed to achieve comparable results to more expensive lenses where the correction process is not employed. Thus for example, the process may readily be employed in compact digital cameras and mobile phones to improve image quality without increasing the cost of the optics. To achieve this, the cameras may be calibrated during or at the end of the manufacturing process to determine the correction parameters which may subsequently be employed to correct acquired images. In more expensive cameras, such as digital SLR's where the lenses may be changed, the firmware of the camera may be configured to include the above described correction process. In this arrangement, the camera firmware may be configured initially or updated to determine the correction model parameters. In this arrangement, the correction model parameters may be determined by running through a calibration routine performed by the firmware for each lens of the user. The determined calibration settings may then be associated with the individual lens, e.g. by reference to the identification of the lens when it connects to the camera or alternatively by selection of the user from a menu. It will be appreciated that users may prefer not to have this complexity or they may prefer to share the information between several cameras. In this scenario, the parameters for the correction may be stored in a memory card or similar and loaded into the camera as required. This type of scenario is known where user's custom settings may be saved and retrieved from a memory card. In another arrangement, the lenses are calibrated during their manufacturing process to determine appropriate correction parameters and these parameters are stored as meta data within the lens for loading by a camera subsequently when connected. The correction of an image taken with a lens could then be implemented onboard the devices hardware (similar to the white balance function) or on an external processor. In addition to imaging systems for cameras, the technology may also be applied to industrial inspection systems and image projection systems. In the case of image projection systems it will be appreciated that the distortion occurs in reverse to a camera, i.e. the original image is perfect and it is the projection through the lens that introduces distortion. To address this, the corrections would be applied to the data sent to the projector (or indeed within the projector) such that when the corrected image is transmitted through the lens, the viewer sees the original and thus uncorrected image The image processing path is modified slightly within this processing path as would be appreciated by the person skilled in the art. Similarly, the method is not restricted to stills cameras and may be applied to video. Thus for example, correction for distortion could be applied to frames from a webcam before transmission from a computer.

Moreover, the potential impact of a commercially available method to calibrate and optimally remove lens distortion is quite vast, and it is difficult to touch on every conceivable application area Some general things to note is that the equations and method are applicable to any lens system, such as infrared cameras and laser scanning systems. The developed method is directly applicable to these technologies, only limited by the calibration target design. With regard to the application to images, it is important to be aware that although this method is not a full calibration technique, the absence of lens distortion vastly simplifies the subsequent complete calibration. In this sense, the method influences such areas where full calibration is required. The following is a incomplete overview of the areas where there is obvious commercial potential relating just to camera technologies.

Theoretically, any imaging system that makes image measurements assuming a pinhole or perspective image formation model will benefit from this invention. For example, specific advantageous are gained for the various existing and developing 3D camera sensors such as stereo, depth from focus, defocus, shading, shadow and more. For precise operation these methods at least need to be free of lens aberrations. In medical imaging field, the method has direct application to the correction of endoscopic images.

Vision inspection systems are widely used within industry due to their unique capabilities and reliability. They are employed in many different areas, from pharmaceuticals to automated computer manufacturing. With the advent of precise distortion calibration, the constraints on the lens are relaxed, allowing the use of lower focal lengths with wider field of view to position the cameras closer to the objects. This both reduces the cost of the optical system and yields a much smaller and compact inspection stage. The straightforward calibration procedure allows easy on site calibration without expert knowledge or precise positioning equipment.

Another related idea is the use of very low focal length lenses in TV systems, to avoid having to elevate a camera (and operator) to large heights to capture birds eye views such as often seen in sports coverage. Much lower elevations may be used with fish-eye type lenses followed by correction for distortion and optimal image re-formatting as described by the present invention. The resulting image will appear to have been taken from an enormous height if the lens field of view is up to 160 to 170 degrees.

Digital camera technology is evolving to the stage where the image undergoes significant processing within the camera. The developed methods, including the optimal image regeneration may be included to correct for lens aberrations within the camera DSP. Such an ability to post-correct an image will allow less emphasis to be placed on the lens. This has a clear expanding market in compact phone cameras, where the limiting factor is the physical dimensions of the lens. Additionally, the calibration may be offered to professional photographers in the form of a stand alone software to increase the quality of their images.

In addition to visible light frequencies, many lens systems exist that measure different sets of frequencies, such as Infra-red cameras and laser measurements cameras. These devices are equally subject to lens distortions, especially if the lenses are not fully optimized for the particular wavelengths used. The present invention is directly applicable to such problems. This may involve altering the nature of the input calibration grid to enable suitable control point detection within the particular imaging modality. The correction systems could then equally be applied within the capturing device, or subsequently on external processing equipment.

To demonstrate the effectiveness of the method (METHOD 1) described herein, a comparison was performed with three other methods (METHODS 2-4).

The assessment was conducted in terms of evaluating how accurate the estimated parameters are in describing lens distortion throughout the image. Generally, it is not enough to merely find the value or the parameters with respect to the objective criteria. It is also important to evaluate the uncertainty attached to the result, taking into account the uncertainty in the data. The three methods were taken from the literature for comparison purposes. These include two full calibration methods and one truism based method.

From a least squares or nonlinear least squares estimation problem the residual error vector may be calculated. However, instead of calculating this residual, an alternative one is compiled directly using new data. Under the assumption that data error has a zero mean normal random distribution Λ/(0, σ_((2,n))), the estimation algorithm is asymptotically efficient, implying that with enough data points the exact solution may be recovered. The parameter uncertainty may be estimated from the Fisher information matrix, in Equation 21:

$\begin{matrix} {{F\left( \hat{\varphi} \right)} = {\sum\limits_{i = 1}^{n}{\frac{1}{\sigma_{i}^{2}}\frac{\partial{e^{T}\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right)}}{\partial\hat{\varphi}}\frac{\partial{e\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right)}}{\partial{\hat{\varphi}}^{T}}}}} & \left. 21 \right) \end{matrix}$

F⁻¹({circumflex over (φ)}) is then used to characterize the uncertainty in the parameters, by forming an estimate of the associated Standard Deviation (SD) as the square root of the i^(th) diagonal element as: SD({circumflex over (φ)}_(i))=√{square root over (diag_(i)(F⁻¹({circumflex over (φ)}))}

In the special case where all the r_(n) ²'s are equal and possibly unknown:

$\begin{matrix} {{F\left( {\hat{\varphi}}_{i} \right)} = {\sum\limits_{i = 1}^{n}{\frac{1}{\sigma_{i}^{2}}\frac{\partial{e^{T}\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right)}}{\partial\hat{\varphi}}\frac{\partial{e\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right)}}{\partial{\hat{\varphi}}^{T}}}}} & \left. 21 \right) \end{matrix}$

F⁻¹({circumflex over (φ)}) is then used to characterize the uncertainty in the parameters, by forming an estimate of the associated Standard Deviation (SD) as the square root of the i^(th) diagonal element as SD( φ)=√{square root over (diag_(i)(F⁻¹({circumflex over (φ)})))}

In the special case where all of the σ_(n) ²'s are equal and possibly unknown:

${\hat{\sigma}}^{2} = {\frac{1}{n - m}{\sum\limits_{i = 1}^{n}\left( {\overset{\Cup}{p} - p - {D\left( {p,\hat{k}} \right)}} \right)^{2}}}$

F⁻¹({circumflex over (φ)}) is the approximated by:

${F\left( {\hat{\varphi}}_{i} \right)} = {\frac{1}{{\hat{\sigma}}^{2}}{\sum\limits_{i = 1}^{n}{\frac{\partial{e^{T}\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right)}}{\partial\hat{\varphi}}\frac{\partial{e\left( {{\overset{\Cup}{c}}_{i},{\hat{\varphi}}_{k}} \right.}}{\partial{\hat{\varphi}}^{T}}}}}$

With the proposed solution, as Method 1, the initial comparison technique is referred to as Method 2. The full calibration technique takes multiple views of a planar pattern as input. Although distortion calibration is not the main focus of this technique (no decentering and a low order radial (2 parameters) model is used), it provides a useful comparison for lower distortion levels. It is not expected to be highly accurate for larger distortion levels. The method estimates distortion by the numerical solution of the back projection problem in n views with m control points in each view. The available implementation does not return the parameter standard deviations.

Method 3 is also a full calibration method. This method also requires multiple views of a planar calibration object, though 3D coordinates with one image may also be used. Distortion is given prominent focus in this implementation, with the reverse model assumed including decentering distortion. A simplified approximation of its Taylor expansion is used as an inverse. The implementation returns the parameter SD's.

Method 4 is a truism based method, where the estimation is based on the criterion that straight lines in object space must be imaged as straight lines. The input data is formed from the collinear coordinates of the chessboard pattern. This method is implemented by calculating the lines joining the horizontal chessboard intersections as follows:

-   -   1. Initialize the principal point, and 4 parameters of the         reverse distortion model.     -   2. A moment matrix is formed representing the algebraic line fit         to the input data (the Matrix is shown in Equation 22).

$\begin{matrix} {M = \begin{pmatrix} {\sum\limits_{i = 1}^{n}{\overset{\Cup}{x}}_{1}^{2}} & {\sum\limits_{i = 1}^{n}{{\overset{\Cup}{x}}_{1}{\overset{\Cup}{y}}_{1}}} & {\sum\limits_{i = 1}^{n}{\overset{\Cup}{x}}_{i}} \\ {\sum\limits_{i = 1}^{n}{{\overset{\Cup}{x}}_{1}{\overset{\Cup}{y}}_{1}}} & {\sum\limits_{i = 1}^{n}{\overset{\Cup}{y}}_{i}^{2}} & {\sum\limits_{i = 1}^{n}{\overset{\Cup}{y}}_{i}} \\ {\sum\limits_{i = 1}^{n}{\overset{\Cup}{x}}_{i}} & {\sum\limits_{i = 1}^{n}{\overset{\Cup}{y}}_{i}} & n \end{pmatrix}} & \left. 22 \right) \end{matrix}$

-   -   3. Calculate the least square line fit from the Eigenvector         associated with the smallest Eigenvalue.     -   4. Using this line and the input data form the error criterion.     -   5. Minimize this using the Levenberg-Marquardt (LM) method for         the sum of all lines.

Parameter SD's are available upon convergence. A summary of the different properties of each method is given in the table of FIG. 3. The majority of these methods do not include decentering distortion. In order to compare like-with-like decentering distortion is not included in the distortion model of the proposed algorithm, (Method 1).

Comparisons on simulated data are made with respect to varying control point locations and increasing levels of control point noise. Distortion is simulated using a nonstandard formulation in order that the resulting profile does not exactly match with any of the calibration models. Considering a divisional model as described in GB2380887 extra nonlinear terms may be added as follows:

{hacek over (c)}=c/(1−k₁r²−k₂r⁴), where c=(u, v, 1)^(T) are the undistorted points, {hacek over (c)} are the distorted counterparts and r²=(u−u_(o))2+(v−v_(o))². The center of distortion t=(u_(n), v_(o), 1)^(T) is fixed at approximately u_(o)=732.33 and v_(o)=812.21. Distortion parameter k₁ is varied in the range of −2 to 1.4 with k₂ specified as k₂=−k₁/2, representing a wide range of barrel and pincushion distortions. The lowest level of distortion is k₁=0.01, effectively showing on the graphs as zero.

The calibration data is comprised of a 10×10 planar grid of equally spaced points (spacing=100 (pix)). Random positions of these points are simulated using a 3D rotation randomly drawn from a specific range of rotation angles, with limited translation. Noise is added to these control points with a normal distribution N (0, σ²), where σ² is in the range approximately between 0 and 1 (pix), well in excess of the expected noise range. The evaluation data includes a 20×20 grid (grid spacing=75 (pix)) covering the entire image window.

The method described herein is compared with three alternative methods for robustness to control point positions. One hundred random control point positions are generated for each distortion level and the accuracy and stability of each method is evaluated. Accuracy is measured using the estimated parameters on the evaluation data set. The stability of each estimated parameter is quantified by its variance throughout the one hundred samples.

The accuracy of the four methods are compared in FIG. 17. The ability to correctly distort a model is primarily linked with the underlying distortion model. As FIG. 17 shows, the reverse model in Method 3 and 4 is more unstable than the forward model used in Method 1 and 2. Method 4 is shown to be highly dependent on the location of the control points. Method 1 outperforms all other methods with much lower distortion residuals, indicating that the proposed algorithm is not dependent on the location of control points and its use of a higher order model than Method 2 does not lead to instabilities.

Each method involves estimating the distortion center. FIG. 18 illustrates the x and y errors for the estimated center point for the four methods over 100 random placements of the calibration data and subject to varying distortion. This shows that the center point in the line based method is quite sensitive to the location of the calibration data. The performance of Methods 2 and 3 are roughly similar (excluding the peak errors at k₁=0.01 for Method 3). The method of the present invention shows a very low center point error in comparison. This demonstrates the high stability of the algorithm and the high accuracy afforded by the use of an appropriate distortion model.

The parameter values and standard deviations of each method are shown in FIGS. 19-22. These show the variation of the parameters with distortion and their integrity with respect to varying control point positions. As expected, the present method and method 2 which employ forward distortion models show bounded parameter values. In contrast, the parameter values for methods using the reverse model are much larger. The line based method shows large parameter and SD values, indicating in conjunction with its poor residual accuracy that this algorithm fails to converge for many of the position samples.

The proposed algorithm is compared with the three alternative methods for robustness to noise in control point positions. The 3D position of the control points are fixed throughout. For each simulated distortion level, noise with a distribution of N (0, σ²) is added for 100 samples. The noise variance σ² is then varied through 0→1 (pix). As this generates a significant quantity of data, only the residual distortion is presented, for the range of barrel distortion only.

The residual errors are presented in FIGS. 4-7. FIG. 4 presents the residual results for the proposed method, (Method 1). It can be noted from these results that for zero distortion levels, a larger residual error is induced than for the other distortion levels. This is due to the incorrect classification of noise in the data as actual distortion. Excluding this zero level distortion, the residual SD increases in direct proportion with the induced noise. All residuals remain in the subpixel range. It can be confidently concluded that the proposed algorithm copes successfully with noise.

In comparison, Method 2 shows a larger residual error. As this method also uses the forward model of distortion, its increase in error is proportional with the increase in noise variance. Method 3 uses the reverse model of distortion, and the results in FIG. 6 show that the residual error is larger than that of Method 2. However, in terms of robustness to noise, the algorithm appears to cope successfully. The final line based method, Method 4, also uses the reverse model, but to a higher order. The high order reverse model has been shown to have instability tendencies, so the increase in noise levels induces a large increase in residual error. Indeed for some samples, the algorithm failed to converge and in others, convergence is questionable.

The comparison of the present method with the line based method shows a very considerable improvement. The line based method fails to reach this performance despite using a high order model. One reason for this is that no geometric relationship exists between the objective error and the distortion. The ill conditioning induced by the reverse model at high distortion levels hampers its performance further, all culminating in the tendency to lodge in local minima and in some cases fail to converge due to singularities in the estimation moment or co-factor matrix. The poor estimation performance may be additionally observed in the widely varying estimates for the center of distortion. It is not suitable for larger distortion levels.

In comparison with the full calibration technique of Method 3, the proposed technique shows a significant performance increase. This method used the reverse model and hence failed to achieve comparable residual results. This algorithm is restricted to low levels of distortion as an increase in distortion model order would lead directly to increased sensitivity and ultimately poorer performance. The side-by-side analysis with the full calibration technique of Method 2, primarily indicates the proposed method achieves smaller residual error. This may be expected as both techniques use the forward distortion model, only to a higher order in Method 1. Despite the use of this higher order model, no adverse consequences arise from its use such as instabilities in the estimation problem. Actually, the comparisons on the recovered centers of distortion show that the proposed method achieves far superior stability in its estimation than Method 2.

The experiments conducted on simulated data clearly show that the proposed algorithm outperforms the comparison techniques on an accuracy front. The improvement in accuracy may be attributed to the use of an appropriate distortion model, the estimation algorithm still performs equally as well as the methods that require multiple inputs of data points. The simulations also show that the proposed algorithm at least matches the stability of full calibration methods, and surpasses them in many cases such as in the estimation of the distortion center. In summary, it is shown to be suitable for distortion levels of all kinds, with good invariance to control point location and noise.

Comparisons on real data are compiled with seven different samples of distortion, arranged in increasing order. FIG. 8 gives a brief description of the camera type and image resolution of each sample. Three images were input into the full calibration techniques of Methods 2 and 3, while the first of these was used in the single image methods. As an example, sample number 5 from this data set is shown in FIG. 9. One additional image is used for the residual distortion evaluation of all four methods. These residuals are compiled, with one exception, by undistorting the evaluation image and estimating a radially weighted homography on this data. The residuals for the line based Method 4 are compiled directly by undistorting the data. A radially weighted homography is then computed on these coordinates. This avoids the addition of extra inaccuracies through the use of an inverse approximation to undistort the image. All chessboard intersection points are estimated from an initial guess using the nonlinear line intersection method described in the accompanying additional information document, with a small local support in order to avoid the introduction of bias.

The number of iterations required for each method to converge is also presented in FIG. 8. This shows that there is a less computational overhead with the proposed method. It should also be noted that no optimization is conducted within the Gauss-Newton method (used by Method 1), unlike the comparison methods which use a combination of a Gradient Decent and Gauss-Newton (LM) to speed up convergence.

Firstly, each method is examined for the residual distortion remaining after correction. These residuals are presented in FIG. 10 in mean (SD).

FIG. 10 shows that the proposed method achieves a lower residual error than any of the comparison methods. Methods 3 and 4 show slightly erratic performances. As the improvement in performance of the proposed method may be attributable to the higher order model used, an extra comparison was conducted using a two parameter distortion model in Method 1. This is the same model as used in Method 2. The results are presented in FIG. 11 for comparison with those of Method 2. These results show that the proposed method still achieves an overall lower residual error. This comes despite the fact that Method 2 uses three times the amount of input data than Method 1 in these experiments. The undistorted images for Sample 5 are shown in FIGS. 12A, 12B and 12C. FIG. 12A shows Method 1, FIG. 12B shows Method 2 and FIG. 12C shows Method 3. A residual distortion is observable in the image undistorted with Method 3.

The values and uncertainties of each estimated parameter is presented for Methods 1-4 in FIGS. 13-16 respectively. Method 4 shows as expected large parameter values and uncertainty for larger distortion levels. Method 3, using a two parameter version of the reverse model, exhibits a similar trend, only with a lower magnitude. Method 2, using a two parameter version of the forward model, shows bounded values. Method 1 also shows bounded parameter magnitudes with small error bands. This confirms the results obtained on simulated data, and indicates the suitability of a high order forward model for distortion calibration.

The estimates of the distortion center for each method are presented in FIG. 23. These show that Method 1 recovers the center point very close to that of the full calibration Method 2. This indicates a close relationship between the center point of distortion and the principal point (as recovered by Method 2). Method 3 recovers a similar principal point except in the samples where the distortion is poorly modeled, e.g. sample no. 5.

Following the results obtained with simulated data, the experiments with real images aim to confirm these findings. In this sense, Method 4 is shown to have erratic accuracy and a tendency for high uncertainty in its parameters. In comparison, Method 1 significantly improves upon the performance of Method 3, from a distortion removal point of view. As in the simulated case, there is also a clear improvement in the accuracy of Method 1 in comparison with Method 2.

It was slightly unclear if the proposed algorithm would match the performance of Method 2 using a lower order distortion model. This was investigated with the comparison of both methods using the same distortion model. It revealed that on average Method 1 achieved a slightly lower distortion residual. This indicates the robustness of the proposed approach, considering that Method 2 uses, in this case, three times the amount of input data. The center point is reliably estimated, with very similar locations to that of the full calibration techniques that require more than one image for its recovery. However, this is not the case for the line based Method 4, which shows unreliable center point estimates.

In conclusion, the experiments with real and simulated data clearly demonstrate that the present method outperforms all comparison methods in terms of accuracy in calibrating and removing distortion. This level of accuracy is achieved while using less input data, requiring only one view. The parameter estimates are shown to be reliable, and lend themselves to a well conditioned problem. Additionally, the real experiments show that there is less computational overhead than the comparison methods. These factors in combination with the more accessible closed form solution, appropriate distortion modeling and unique minimization of pixel distortions in resampling, make this method a highly suitable non-metric method for removing lens distortion of all levels in perspective camera.

A novel aspect of this approach is the formulation to recover the previously unknown projections of the true undistorted coordinates of the particular calibration object. This allows the objective derivatives to be readily computed and estimated using standard non-numerical techniques. A unique feature of the formulation is its ability to model decentering distortion of lens assemblies without its explicit parametric inclusion. The basic idea may be visualized as a ‘planarity of planes’ approach in contrast to the ‘straightness of lines’ method.

Secondly, a new idea is proposed to optimally form a new aberration free image in order to reduce the unavoidable resampling distortions such as stretching and shearing. The end result is that the new image contains less noise than an unoptimized image, while also having a wider field of view for normal barrel lens distortion.

Due to the new formulation of the problem, certain key advantages are gained over the existing collection of solutions. The forward model of lens distortion is used, in comparison with other nonmetric approaches which are forced to use the reverse model or a variation, and cannot avail of its advantages. Decentering distortion is naturally modeled by the particular formulation without the need for additional parameters. The precision to which lens distortion may be modeled and removed is very high. The accuracy is shown to outperform other alleged nonmetric approaches and, match and often outperform the performance of complete bundle adjustment methods. In addition to this accuracy, the distortion calibration is shown to be very stable unlike many non-metric alternatives. This precision and stability is not limited to a small domain of lens distortions, but effectively covers all possible or practical levels of lens distortions in perspective cameras, from very low focal lenses such as fish-eye, to very high focal length lenses. In contrast, alternative full calibration and nonmetric methods are only suited to mild levels of distortion.

Complete calibration methods, and their associated relative complexity are not suitable for all applications. Many situations exist wherein only the nonlinear distortion calibration is required. The current means of calibrating distortion only relies on existing nonmetric approaches. These algorithms are not without their own complexity, involving a cumbersome phase of line segmentation and recovery. In contrast the proposed method utilizes the existing relatively straightforward planar detection methods associated with full calibration methods. Only one view of this planar target is required to completely solve the problem. The two constraints that are imposed on the target, that of planarity and known structure up to scale (these constraints, and more, apply to the full calibration methods), are easily attained.

The distortions introduced during the removal of lens distortion through interpolation are also considered for the first time. This is an integral part of the distortion calibration process if undistorted images are the desired end result. These optimized images contain less noise and retain more pixel information.

The different elements of the process will now be explained with reference to an exemplary calibration process which is employed initially. The data obtained from the calibration step is subsequently employed in the correction process. The calibration process comprises a series of steps, as illustrated in the process flow of Figure ?. The initial step comprises the setting up of the imaging apparatus such as a camera in a test configuration. The camera may be set up on a tripod or other support and directed at a reference (e.g. chessboard) image. As will be explained below, the reference object is suitably selected to simplify the subsequent processing of the data. The reference object is positioned a distance away from camera. However as explained above this is not critical but merely requires the target to be fully encompassed with the image. As, a measure of distortion is being obtained it is important to capture an image of a specific known target so that the method attempts to correct the captured image appropriately in determining the model. Thus the reference object (target) is suitably selected to facilitate the subsequent image analysis aspect of the calibration process. An example of a suitable reference object is a planar surface with a checkerboard pattern defined thereon. A checkerboard pattern is suitable since the positions of the corners of the individual squares may readily be identified using conventional corner detection techniques. Suitably, the number of squares in the pattern would ensure that each square represented a pixel area in the image of x by x pixels, where x is suitably a value in the range of 40 to 200 pixels depending on the sensor size to meet the minimum number of control points required. Once the camera, lens and target have been appropriately set up, an image is acquired by the camera and the mathematical methods described above applied to determine the appropriate parameters for a correction model. This correction model, as will be appreciated from above, allows for correction to be applied to any subsequent images captured by the imaging system.

Other ways of implementation apply as long as the elements of the present invention are included.

In addition to the description of specific, non-limited examples of embodiments of the invention provided herein, it should be appreciated that the invention can be implemented in numerous other applications involving the different configurations of video-processing equipment. Although the invention is described hereinbefore with respect to illustrative embodiments thereof, it will be appreciated that the foregoing and various other changes, omissions and additions in the form and detail thereof may be made without departing from the spirit and scope of the invention. 

1. A method for determining lens distortion parameters for an imaging system comprising a lens and an imaging device, the method comprising the steps of: capturing an image of a target with a known structure through the lens, the target comprising a known planar structure comprising a plurality of control points; detecting the positions of the plurality of control points in the captured image, performing a Euclidean transform on the detected control points, calculating an estimate for the positions of the control points without distortion through a projective transformation of their known structure in conjunction with a distortion model applied to these estimated control points to provide a estimated location for the distorted control points, comparing these estimated locations to the Euclidian transformed detected control points while simultaneously refining the estimated positions through the projective transformation, the distortion model and the Euclidean transform of the measured control point coordinated, to minimize the difference, and storing the distortion model once the difference has been minimized. 2.-13. (canceled)
 14. A method according to claim 1, further comprising the step of applying the distortion model with the stored model parameters to correct a further captured image to produce an undistorted image.
 15. A method according to claim 14, further comprising the step of scaling the captured image.
 16. A method according to claim 15, wherein the degree of scaling is determined directly from the distortion model to minimize the average pixel stretch throughout the image.
 17. A method according to claim 1, wherein the test pattern is a checkerboard pattern and the test points are the corners of the squares.
 18. A method for determining lens distortion parameters for an imaging system comprising a lens and an imaging device, the method comprising the steps of: capturing an image of a target with a known structure through the lens, the target comprising a known planar structure comprising a plurality of control points; detecting the positions of the plurality of control points in the captured image, estimating positions of the detected control points without distortion by applying a Euclidian transform to the detected values in conjunction with a distortion model applied to the Euclidian transformed detected values, comparing these estimated points without distortion to the estimated positions of the control points without distortion obtained through the projective transformation of their known structure and adjusting the parameters of the distortion model, Euclidean transform and estimated values to minimize the difference, and storing the distortion model once the difference has been minimized.
 19. A method according to claim 18, further comprising the step of applying the distortion model with the stored model parameters to correct a further captured image to produce an undistorted image.
 20. A method according to claim 19, further comprising the step of scaling the captured image.
 21. A method according to claim 20, wherein the degree of scaling is determined directly from the distortion model to minimize the average pixel stretch throughout the image.
 22. A method according to claim 18, wherein the test pattern is a checkerboard pattern and the test points are the corners of the squares.
 23. A method for determining lens distortion parameters for an imaging system comprising an imaging device and lens, the method comprising: capturing an image of a target through the lens, the target comprising a known planar structure comprising a plurality of control points; detecting the positions of the plurality of control points in the captured image, transforming the detected positions of the control points into a lens centric co-ordinate system using initial transformation values, computing an estimate for the positions of the control points without distortion in conjunction with a distortion model applied to the estimated control points to provide a estimated location for the distorted control points, and comparing and simultaneously refining the estimated positions, the parameters of the distortion model and the initial transformation values to minimize the difference between the estimated positions of the control points and the transformed detected positions of the control points, and storing the distortion model parameters once the difference has been minimized.
 24. A method according to claim 23, further comprising the step of applying the distortion model with the stored model parameters to correct a further captured image to produce an undistorted image.
 25. A method according to claim 24, further comprising the step of scaling the captured image.
 26. A method according to claim 25, wherein the degree of scaling is determined directly from the distortion model to minimize the average pixel stretch throughout the image.
 27. A method according to claim 23 wherein the test pattern is a checkerboard pattern and the test points are the corners of the squares.
 28. An imaging system comprising a lens and an imaging device, wherein the system is adapted to perform the method of claim
 23. 29. An imaging system according to claim 28, wherein the imaging system is a camera imaging device is a sensor.
 30. A camera according to claim 29, wherein the sensor is a CCD device.
 31. An imaging system according to claim 30, wherein the imaging system is a projector.
 32. A projector according to claim 31, wherein the imaging device is a LCD device. 